<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <style>
        *{
            margin: 0px;
            padding: 0px;
            list-style: none;
        }
        #main{
            width: 1200px;
            border: 1px solid red;
            display: flex;
            justify-content: space-between;
            margin: 0 auto;
        }
        li{
            width: 280px;
            border: 1px solid #333;
            text-align: center;
        }
        li>img{
            width: 100%;
            display: block;
        }
    </style>
</head>
<body>
    <ul id="main">
        <!-- <li>
            <img src="../images/1.webp" alt="">
            <p></p>
        </li>
        <li></li>
        <li></li> -->
    </ul>
    
</body>
</html>
<script>
    var omain=document.getElementById("main");    
var ary=[{title:"手表1",id:1,price:888,src:"../images/1.webp"},{title:"手表2",id:2,price:988,src:"../images/1.webp"},{title:"手表3",id:3,price:18888,src:"../images/1.webp"}];

var str="";
ary.forEach(function(item,index){
    str+=`<li>
            <img  src="${item.src}" alt="">
            <p>${item.title}</p>
            <p>价格<span>${item.price}</span></p>
        </li>`

});
omain.innerHTML=str;

   
</script>